Package edu.claflin.finder
Class Global
- java.lang.Object
-
- edu.claflin.finder.Global
-
public final class Global extends java.lang.ObjectHolds "Global" data that needs to be accessed by multiple parts of the program. Should a piece of data, like the LogUtil reference or the output directory, need to be shared by multiple parts of the program it will be stored here. This is a static class and requires no instantiation.- Version:
- 3.1 May 28, 2015
- Author:
- Charles Allen Schultz II
-
-
Constructor Summary
Constructors Modifier Constructor Description privateGlobal()Private constructor for preventing instantiation of the class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddestroyLogger()Destroys the LogUtil reference.static LogUtilgetLogger()Gets the logger.static java.io.FilegetOutput()Gets the output directory for storing results.static voidmakeLogger(LogLevel maxGranularity, boolean[] fileLogs, boolean[] terminalLogs)Instantiates the logger field.static booleansetOutput(java.io.File file)Sets the output directory for storing results.
-
-
-
Field Detail
-
logger
private static LogUtil logger
The LogUtil reference used for logging data in the program.
-
output
private static java.io.File output
The output directory for storing results. Defaults to the working directory.
-
-
Method Detail
-
makeLogger
public static void makeLogger(LogLevel maxGranularity, boolean[] fileLogs, boolean[] terminalLogs)
Instantiates the logger field.- Parameters:
maxGranularity- the maximum granularity of the log messages.fileLogs- the boolean array indicating file log settings.terminalLogs- the boolean array indicating terminal output settings.
-
destroyLogger
public static void destroyLogger()
Destroys the LogUtil reference. Calls the destroy() method on the logger field if the logger field is not null.
-
getLogger
public static LogUtil getLogger()
Gets the logger.- Returns:
- the LogUtil reference used for logging in the program.
-
setOutput
public static boolean setOutput(java.io.File file)
Sets the output directory for storing results.- Parameters:
file- the File representing the new output directory.- Returns:
- a boolean indicating if the output directory was successfully set.
-
getOutput
public static java.io.File getOutput()
Gets the output directory for storing results.- Returns:
- the File representing the output directory.
-
-